apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: heapster-v1.2.0
  namespace: kube-system
  labels:
    k8s-app: heapster
    kubernetes.io/cluster-service: "true"
    version: v1.2.0
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: heapster
      version: v1.2.0
  template:
    metadata:
      labels:
        k8s-app: heapster
        version: v1.2.0
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ''
        scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
    spec:
      containers:
        - image: k8s.gcr.io/heapster:v1.2.0
          name: heapster
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8082
              scheme: HTTP
            initialDelaySeconds: 180
            timeoutSeconds: 5
          resources:
            # keep request = limit to keep this container in guaranteed class
            limits:
              cpu: {{ metrics_cpu }}
              memory: {{ metrics_memory }}
            requests:
              cpu: {{ metrics_cpu }}
              memory: {{ metrics_memory }}
          command:
            - /heapster
            - --logtostderr=true
            - --source=kubernetes.summary_api:''
            - --sink=influxdb:http://monitoring-influxdb:8086
        - image: k8s.gcr.io/heapster:v1.2.0
          name: eventer
          resources:
            # keep request = limit to keep this container in guaranteed class
            limits:
              cpu: 100m
              memory: {{ eventer_memory }}
            requests:
              cpu: 100m
              memory: {{ eventer_memory }}
          command:
            - /eventer
            - --logtostderr=true
            - --source=kubernetes:''
            - --sink=influxdb:http://monitoring-influxdb:8086
        - image: k8s.gcr.io/addon-resizer:1.6
          name: heapster-nanny
          resources:
            limits:
              cpu: 50m
              memory: {{ nanny_memory }}
            requests:
              cpu: 50m
              memory: {{ nanny_memory }}
          env:
            - name: MY_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: MY_POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          command:
            - /pod_nanny
            - --cpu={{ base_metrics_cpu }}
            - --extra-cpu={{ metrics_cpu_per_node }}m
            - --memory={{ base_metrics_memory }}
            - --extra-memory={{ metrics_memory_per_node }}Mi
            - --threshold=5
            - --deployment=heapster-v1.2.0
            - --container=heapster
            - --poll-period=300000
            - --estimator=exponential
        - image: k8s.gcr.io/addon-resizer:1.6
          name: eventer-nanny
          resources:
            limits:
              cpu: 50m
              memory: {{ nanny_memory }}
            requests:
              cpu: 50m
              memory: {{ nanny_memory }}
          env:
            - name: MY_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: MY_POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          command:
            - /pod_nanny
            - --cpu=100m
            - --extra-cpu=0m
            - --memory={{ base_eventer_memory }}
            - --extra-memory={{ eventer_memory_per_node }}
            - --threshold=5
            - --deployment=heapster-v1.2.0
            - --container=eventer
            - --poll-period=300000
            - --estimator=exponential
      securityContext:
        seLinuxOptions:
          type: spc_t
